package kz.pompei.oneGwtStands.client.remote.data;

import java.util.HashSet;
import java.util.Set;

import kz.pompei.OneGwt.cmodel.PersonDetails;
import kz.pompei.OneGwt.cmodel.PersonRecord;

public class PersonEntity {
  private String id;
  private String surname;
  private String name;
  private String patronymic;
  private String accountId;
  private boolean active = true;
  private boolean deleted = false;
  
  private final Set<String> roleIds = new HashSet<String>();
  
  public PersonDetails toDetails() {
    PersonDetails ret = new PersonDetails();
    {
      ret.setId( getId() );
      ret.setSurname( getSurname() );
      ret.setName( getName() );
      ret.setAccountId( getAccountId() );
      ret.setActive( isActive() );
    }
    return ret;
  }
  
  public PersonRecord toRecord() {
    PersonRecord ret = new PersonRecord();
    {
      ret.setId( getId() );
      ret.setFio( getSurname() + " " + getName() );
      ret.setAccountId( getAccountId() );
      ret.setActive( isActive() );
    }
    return ret;
  }
  
  public String getId() {
    return id;
  }
  
  public void setId(String id) {
    this.id = id;
  }
  
  public String getSurname() {
    return surname;
  }
  
  public void setSurname(String surname) {
    this.surname = surname;
  }
  
  public String getName() {
    return name;
  }
  
  public void setName(String name) {
    this.name = name;
  }
  
  public String getPatronymic() {
    return patronymic;
  }
  
  public void setPatronymic(String patronymic) {
    this.patronymic = patronymic;
  }
  
  public String getAccountId() {
    return accountId;
  }
  
  public void setAccountId(String accountId) {
    this.accountId = accountId;
  }
  
  public boolean isActive() {
    return active;
  }
  
  public void setActive(boolean active) {
    this.active = active;
  }
  
  public boolean isDeleted() {
    return deleted;
  }
  
  public void setDeleted(boolean deleted) {
    this.deleted = deleted;
  }

  public Set<String> getRoleIds() {
    return roleIds;
  }
}
